package com.emm.yixun.jobs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.emm.yixun.common.app.base.CommonResDTO;
import com.emm.yixun.common.response.Response;
import com.emm.yixun.customer.service.FollowServiceFacade;
import com.emm.yixun.system.service.NoticeServiceFacade;

/***
 * 客户跟进
 * 描述:
 * 	对客户写跟进时若选择了下次跟进时间，则在选日的日期日提醒客户，每设置一条提醒一次。
 */
@Component
public class CustomerFollowJob {
	 private static Logger logger = LoggerFactory.getLogger(CustomerFollowJob.class);

	 @Autowired
	 private FollowServiceFacade followServiceFacade;
	 
     @Scheduled(cron="${quartz.cron.createCustomerFollow}")
     public void CustomerFollow(){
    	 logger.info("客户关怀消息创建 job start..........");
    	 Response<CommonResDTO> response = followServiceFacade.customerFollowPushMsg();
    	 if (response.isSuccess()) {
  			logger.info("..........客户关怀消息创建成功..........");
  		 } else {
  			logger.info("..........客户关怀消息创建失败..........");
  		 }
    	 logger.info("客户关怀消息创建 job end..........");
     }

}
